<?php include 'inc/student_head.php'; ?>

<style type="text/css">
    .row1{margin:20px auto;
        background-image: url('/statics/imgs/bg/bg02.png');
        background-color: #e0e0e0;width: 90%;padding:20px;}
    .content{margin:10px;}
    .a{padding:5px;font-size:12pt;font-weight: bold;text-align: center;}
    .b{padding:5px;font-size:10pt;text-align:center}
    .top1 img{width:128px;}
    .top2 img{width:64px;}
    .top3 img{width:48px;}
</style>




<div class="layui-row row1 openDiv">
    <div class='layui-col-xs7'>
        <div class="layui-row content">

<?php
$content=$this->data;
if(count($content)>0){
    echo '<table class="layui-table" style="height:400px">';
    printf('<td class="a">班级</td>');
    printf('<td class="a">座位</td>');
    printf('<td class="a">姓名</td>');
    printf('<td class="a">速度</td>');
    printf('<td class="a">准确率</td>');
    printf('<td class="a">综合评分</td>');
    printf('<td class="a">高手排名</td>');


    foreach($content as $k=>$v){
        echo '<tr>' ;
        printf('<td class="b">%s</td>',$v[0]);
        printf('<td class="b">%s</td>',$v[1]);
        printf('<td class="b">%s</td>',$v[2]);
        printf('<td class="b">%s</td>',$v[3]);
        printf('<td class="b">%s%s</td>',$v[4]*100,'%');

        printf('<td class="b">%s</td>',number_format($v[5],3));
        switch ($v[6]) {
            case '1': //第1名
                printf('<td class="b top1"><img src="/statics/imgs/top1.jpg"></td>');
                break;
            case '2': //第2名
                printf('<td class="b top2"><img src="/statics/imgs/top2.jpg"></td>');
                break;
            case '3': //第3名
                printf('<td class="b top3"><img src="/statics/imgs/top3.jpg"></td>');
                break;
            default:
                printf('<td class="b">%s</td>',$v[6]);
                break;
        }
        echo '</tr>' ;

    }

    echo '</table>';
}else{
    echo "<ul>";
    echo "<li><a  style='margin-top:100px;width:380px;height:60px;font-size:20pt;padding:10px;'
        class='layui-btn layui-btn-danger'>新赛季S2 已开启!</a></li>";
    echo "<li><a  style='margin-top:10px;width:380px;height:60px;font-size:20pt;padding:10px;'
        class='layui-btn layui-btn-normal' target='_blank' href='/_upFiles/教师yjh/打字高手截图/高手榜1.png'>S1赛季 结算图</a></li>";
    echo "</ul>";


}
?>

        </div>


    </div>

    <div class='layui-col-xs5' style='padding:20px;padding-left:80px;text-align:left;'>
        <ul style='line-height: 30pt;font-size:12pt;margin-top:30px;'>
            <h2>新赛季上榜规则:</h2>
            <li>1、使用《全民打字高手》 进行挑战</li>
            <li>2、速度95以上 正确率95%以上</li>
            <li>3、通过时会自动保存截图到桌面</li>
            <li style='color:red'>注：以后只接收从这里上传的成绩截图</li>
            <li>
                <input type="button" value='点这里上传成绩截图' class='layui-btn' id='upload'  />
            </li>

            <br>
            <h2>赛季积分奖励:</h2>
            <li>1、期中、期末考试后各结算一次</li>
            <li>2、所有上榜者按排名获得奖励积分</li>
        </ul>
<br><br>


    </div>


</div>




<script language="javascript">
    layui.use(function() {
        var upload = layui.upload,
            util = layui.util,
            $ = layui.$;
$("#menu_master").addClass('layui-this'); //设置导航当前选中项的样式


// 弹出层
layer.open({
    type: 1,
    title: '<div class="openTitle"><h2>打字高手排行榜</h2></div>',
    anim: 0,
    scrollbar: false,
    area: ['1150px','600px'],
    shade: 0,
    content: $('.openDiv'),
    offset: '100px',
    closeBtn: 2,
    cancel: function(index, layero){
        window.location.href="/student/index";
    }
});

//上传
upload.render({
    elem: '#upload'
    , url: 'upPic'
    , accept: 'file' //普通文件
    , exts: 'bmp|jpg|png' //允许上传的文件类型
    , acceptMime: '.bmp,.jpg,.png' //打开文件框筛选文件类型
    , size: 20 * 1024 //限制文件大小，单位KB
    , before: function() {
       // this.data = {'task': <?=gs('setup')['task_id'] ?>}; //传递参数
    }
    , done: function(res) {
        console.log(res);
        layer.alert(res.msg, {icon: 6 }, function() {
            location.reload();
        });

    }
});




});
</script>


<?php include 'inc/student_foot.php'; ?>


